<?php
	
	ob_start(); 
	session_start(); 

	require_once ("function.php"); 
	$error = '';
	$returnurl = urlencode(isset($_GET["returnurl"])?$_GET["returnurl"]:""); 
	
	if($returnurl == "") 
		$returnurl = urlencode(isset($_POST["returnurl"])?$_POST["returnurl"]:""); 

	$do = isset($_GET["do"])?$_GET["do"]:""; 
	$do = strtolower($do); 

	switch($do) 
	{ 
	case "": 
		if (checkLoggedin()) 
		{ 
			header("location: home.php"); 
		} 

		break; 
	case "login": 
		$username = isset($_POST["username"])?$_POST["username"]:""; 
		$password = isset($_POST["password"])?$_POST["password"]:""; 
	
		if ($username=="" or $password=="" ) 
		{ 
			echo "<h1>Username or password is blank</h1>"; 
			clearsessionscookies(); 
			header("location: partner.php?returnurl=$returnurl"); 
		} 
		else 
		{ 
			
			if(confirmuser($username,md5($password))) // As pointed out by asgard2005 
			{ 
				createsessions($username,$password); 
				if ($returnurl<>"") 
					header("location: $returnurl"); 
				else 
				{ 
					header("Location: home.php"); 
				} 
			} 
			else 
			{ 
				echo "<h1>Invalid Username and/Or password</h1>"; 
				clearsessionscookies(); 
				header("location: partner.php?returnurl=$returnurl"); 
			} 
		} 
		break; 
	case "logout": 
		clearsessionscookies(); 
		header("location: partner.php"); 
		break; 
	} 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0048)file:///C:/wamp/www/Autogator/autogator_bid.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Vehicle's Bid Informations</title>
<link href="css/mainpartner.css" rel="stylesheet" type="text/css"></link>
<script type="text/javascript">
function onload()
{
	

}
</script>
</head>
<body>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/987792179/?value=1.00&amp;label=e3VDCI2dgAMQs4aC1wM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<div class="boxBlack">
<div class="boxBlackTl"><div class="boxBlackTr">
  <h2>Autogator Partner Manager</h2>
</div></div>
<div class="boxBodyBlack">
  <div class="boxLblue floatLeft" style="width:100%;">
  <div class="boxLblueTl"><div class="boxLblueTr">
    <h2>Login</h2>
  </div></div>
<div class="boxBodyLblue">
  <div class="clearBoth"></div>
  <div id="indexcontent_logincol">
   <div style="padding:50px 10px 50px 10px;  width:400px; border:1px #CCC solid;">

<div align='center'></div>

<form name="f1" action="partner.php?do=login" method="post">
<div id="window_list">
	<div id="item"> 
    	<div id="img">User Name</div>
        <div id="data">
          <input type="input" name="username" id="username" class="textbox" value=""/>
        </div>
      
	</div>
    <div id="item">
    	<div id="img">Password</div>
        <div id="data">
          <input type="password" name="password" id="password" class="textbox" value=""/>
        </div>
        
    </div>
    <div id="item">
    	<div id="img"></div>
        <div id="data">
          
        </div>
        
    </div>
     <div id="item">
    	<div id="img"></div>
        <div id="data">
        <input type="checkbox" name="radio" id="remeber" value="remeber" />
          <label for="remeber">Remember password</label>
        </div>
        
    </div>
    <div id="item">
    	<div id="img"></div>
        <div id="data">
          <input type="submit"  name="login" value="Login"/><input type="button"  name="cancel" value="Cancel"/>
        </div>
        
    </div>
   </div></form>

</div></div>

</div>
<div class="boxLblueBl"><div class="boxLblueBr"></div></div>
</div>
  <div class="clearBoth"></div>
  <div class="clearBoth"></div>
</div>
<div class="boxBlackBl"><div class="boxBlackBr"></div></div>
</div>
</script>
</body></html>
